Skip to main content

Follow/Unfollow User

POST /:username/follow

Description

Follows, unfollows, requests to follow, or withdraws a pending request depending on the current relationship and the target account privacy.

Request Parameters

Requires Authentication: true

PATH PARAMS

NameTypeRequiredDescription
usernamestringYesTarget username.

Usage Example

await axios.post(
"https://api.daykeeper.app/johndoe/follow",
{},
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
)

Success Response

Possible messages include:

{ "message": "You started following johndoe" }
{ "message": "You unfollowed johndoe" }
{ "message": "You sent a follow request to johndoe" }
{ "message": "You have withdrawn your request to follow johndoe" }

Error Response

CodeDescription
401Missing or invalid access token
402One of the users is blocked or the target is banned
404User not found
400You cannot follow yourself
500Server error